<template>
  <div class="login">
    <div style="z-index: 10000;
    position: relative;
    top: -80px;
  " class="cd-user-modal is-visible">
      <div class="cd-user-modal-container">
        <br/> <br/> <br/>
        <div style="display: flex">
          <div>
            <img src="../../assets/img/logo.jpg" style="width:55%;position:relative;left: 50px"/>

          </div>
          <div style="font-size:25px;font-weight:bold;"> PersonCoder</div>
        </div>
        <!--      <ul class="cd-switcher">-->
        <!--        <li><a  class="selected">账号密码登录</a></li>-->
        <!--        <li><a >验证码登录</a></li>-->
        <!--      </ul>-->

        <div id="cd-login" class="is-visible is-selected"> <!-- log in form -->
          <el-form class="cd-form " ref="loginForm" :model="loginForm" :rules="loginRules">

            <p class="fieldset">
              <el-form-item prop="username" >
              <label class="image-replace cd-username" for="signup-username">账户名</label>
              <input class="full-width has-padding has-border" id="signin-email"
                     v-model="loginForm.username"
                     ref="username"
                     type="phone" placeholder="请输入用户名">
              <span class="cd-error-message">账户名错误</span>
              </el-form-item>
            </p>


            <p class="fieldset">
              <el-form-item prop="password" >
              <label class="image-replace cd-password" for="signup-password">密码</label>
              <input class="full-width has-padding has-border"
                     v-model="loginForm.password"
                     id="signup-password" type="text" placeholder="请输入密码">
              <span class="cd-error-message">格式错误!</span>
            </el-form-item>
              <a class="cd-switcher selected" style="
							display: inline-block;
							position: absolute;
							right: 0px;
							cursor:pointer;
							bottom: -22px;
							font-size: 14px;
							color: #3277fc;">没有账号,去注册?</a>
            </p>


            <p class="fieldset">
              <input type="checkbox" id="remember-me" checked>
              <label for="remember-me">记住密码</label>
            </p>
            <p class="fieldset">
              <el-button :loading="loading" type="primary" style="width:100%;margin-bottom:10px;height:50px;background: #3277FC"
                         @click.native.prevent="handleLogin">登录
              </el-button>
<!--              <input class="full-width" type="submit"  @click.native.prevent="handleLogin" value="登录">-->
            </p>
          </el-form>
        </div> <!-- cd-login -->
        <div id="cd-signup"> <!-- sign up form -->
          <form class="cd-form">
            <p class="fieldset">
              <label class="image-replace cd-username" for="signup-username">用户名</label>
              <input class="full-width has-padding has-border" id="signup-username" type="text" placeholder="请输入手机号">
              <span class="cd-error-message">格式错误!</span>
            </p>

            <p class="fieldset">
              <label class="image-replace cd-password" for="signin-password">验证码</label>
              <input class="full-width has-padding has-border" id="signin-password" type="text" placeholder="验证码">
              <button href="#0" class="hide-password">发送验证码</button>
              <span class="cd-error-message">密码错误</span>
            </p>

            <p class="fieldset">

              <a class="cd-switcher">
                <li>
                  <a style="
							display: inline-block;
							position: absolute;
							left: -83px;
							cursor:pointer;
							bottom: -26px;
							font-size: 13px;
						color: rgb(50, 119, 252);"><span class="reback">返回登录</span></a></li>
              </a>
            </p>


            <p class="fieldset">
              <input class="full-width has-padding" type="submit" value="注册">
            </p>
          </form>

        </div> <!-- cd-signup -->
        <el-divider>其他登录方式</el-divider>
        <div  style="display:flex;justify-content: space-evenly;">
          <img @click="qqLogin('qq')" class="other" src="../../assets/img/qq.png"/>
          <img class="other" src="../../assets/img/weibo.png"/>
          <img class="other" src="../../assets/img/wechat.png"/>
          <img class="other" src="../../assets/img/dd.png"/>
        </div>
      </div> <!-- cd-user-modal-container -->
      <p style="
		position: absolute;
    bottom: 1em;
    text-align: center;
    width: 100%;font-size: 10px;"> -PersonCoder提供技术支持- </p>
    </div> <!-- cd-user-modal -->

  </div>
</template>

<script>
import {validUsername} from '@/utils/validate'
import Particles from '@/components/particles/index'
import {RondomPass} from '../../assets/js/config'
import {login} from '../../api/user'
import request from "@/utils/request";


export default {
  name: 'Login',
  components: {Particles},
  data() {

    const checkEmail = (rule, value, cb) => {
      // 验证邮箱的正则表达式
      const regEmail = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/

      if (regEmail.test(value)) {
        // 合法的邮箱
        return cb()
      }

      cb(new Error('请输入合法的邮箱'))
    }

    const validateUsername = (rule, value, callback) => {
      if (value.length < 3) {
        callback(new Error('用户名不少于3位'))
      } else {
        callback()
      }
    }
    const validatePassword = (rule, value, callback) => {
      if (value.length < 6) {
        callback(new Error('密码不少于6位'))
      } else {
        callback()
      }
    }
    return {
      forgetDialogVisible:false,
      //忘记密码对象
      forgetForm:{},

      //注册对象
      forms: {
        email: ''
      },
      confirm: '',
      loginForm: {
        username: 'personcoder@qq.com',
        password: '123456'
      },

      rules: {
        email: [
          {required: true, trigger: 'blur', validator: checkEmail}
        ],
        password: [
          {required: true, message: '请输入密码', trigger: 'blur'},
          {min: 3, max: 12, message: '长度在 3 到 12 个字符', trigger: 'blur'}
        ],
        code: [
          {required: true, message: '请输入验证码', trigger: 'blur'},
          {min: 3, max: 12, message: '长度在 3 到 12 个字符', trigger: 'blur'}
        ],
        confirm: [
          {required: true, message: '请再次确认密码', trigger: 'blur'},
          {min: 3, max: 12, message: '长度在 3 到 12 个字符', trigger: 'blur'}
        ],
      },

      loginRules: {
        username: [{required: true, trigger: 'blur', validator: checkEmail}],
        password: [{required: true, trigger: 'blur', validator: validatePassword}]
      },
      loading: false,
      passwordType: 'password',
      redirect: undefined,
      dialogVisible: false,
      userId: sessionStorage.getItem("userid")?JSON.parse(sessionStorage.getItem("userid")):''
    }
  },
  watch: {
    $route: {
      handler: function (route) {
        this.redirect = route.query && route.query.redirect
      },
      immediate: true
    }
  },

created() {
// this.authLogin()
    },
  methods: {
//     authLogin() {
//       console.log(this.$route)
//       console.log("dnakdkjadnka"+this.userId)
//       // 根据UerId查询用户信息
//       // let userId=sessionStorage.getItem("userid")
//       // console.log("<===="+userId)
//       request.get('/auth/login/' + this.userId).then( res => {
// debugger
//         const that = this
//
//         /*   var captcha = new TencentCaptcha(
//              RondomPass().toString(),
//              function (res) {
//                console.log(res)
//                if (res.ret === 0) {*/
// console.log(res)
//
//         // that.$store.dispatch('user/login', this.loginForm).then((res) => {
//         //   // if(res.role=='ROLE_USER'){
//         //
//         //   that.$router.push('/front/home')
//         //   this.$router.go(1)
//         //   localStorage.setItem("user", JSON.stringify(res))
//         //   localStorage.setItem("menus", JSON.stringify(res.menus))  // 存储用户信息到浏览器
//         //   this.$message({type:'success',message:'登录成功'})
//         // })
//
//       })
//     },

    // 第三方登录
    qqLogin(value) {
      if (value == 'qq') {
        var _this = this;
        request.get('/qq/oauth').then(resp => {
          console.log(resp)
          //window.open(resp.data.result, "_blank")
          var width = width || 900;
          var height = height || 540;
          var left = (window.screen.width - width) / 2;
          var top = (window.screen.height - height) / 2;
          var win = window.open(resp.data, "_self",
            "toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, left=" +
            left + ", top=" + top + ", width=" + width + ", height=" + height);
          console.log(_this)
          console.log(win)
          //监听登录窗口是否关闭,登录成功后 后端返回关闭窗口的代码
          // var listener = setInterval(function () {
          //   //监听窗口是否关闭
          //   if (win.closed) {
          //     //进入这个if代表后端验证成功!直接跳转路由
          //     clearInterval(listener);//关闭监听
          //     //跳转路由
          //     var path = _this.$route.query.redirect;
          //     console.log("================>",_this.$route)
          //     console.log("========path========>",path)
          //     _this.$router.replace({
          //       path:
          //           path === "/" || path === undefined ? "/admin/dashboard" : path
          //     });
          //     _this.$router.go(0) //刷新
          //   }
          // }, 500)
        }).catch(fail => {
          console.error(fail)
        })
      }
    },
    forget(){
      this.forgetDialogVisible=true
    },

    openForget(){
      // this.forgetDialogVisible=true

      // window.open(
      //   "https://api.weibo.com/oauth2/authorize?client_id=" +
      //   this.config.WEIBO_APP_ID +
      //   "&response_type=code&redirect_uri=" +
      //   this.config.WEIBO_REDIRECT_URI,
      //   "_self"
      // );
    },

    //邮箱发送
    getEmailCode() {
      this.request.get('/sys/sendEmail/' + this.forms.email).then(res => {
        if (res.code === 200) {
          this.$message({
            type: 'success',
            message: '邮件发送成功'
          })
        } else {
          this.$message.error(res.msg)
        }
      })
    },
    //注册
    register() {
      this.$refs.forms.validate(valid => {
        if(this.forms.email==''){
          this.$message({
            type:'warning',
            message: '请输入邮箱'
          })
          return
        }
        if (valid) {
          this.loading = true
          if (this.forms.password == this.forms.confirm) {
            this.request.post('/sys/loginEmail', this.forms).then((res) => {
              if (res.code == 200) {
                this.$message({
                  type: 'success',
                  message: '注册成功'
                })
                this.dialogVisible = false
                this.forms = {}
              } else {
                this.$message({type: 'error', message: res.msg})
              }
            })
          }else{
            this.$message({type: 'error', message: "2次输入密码不一致"})
          }
        }
      })
    },
    openReg() {
      this.dialogVisible = true
    },
    showPwd() {
      if (this.passwordType === 'password') {
        this.passwordType = ''
      } else {
        this.passwordType = 'password'
      }
      this.$nextTick(() => {
        this.$refs.password.focus()
      })
    },
    handleLogin() {
      this.$refs.loginForm.validate(valid => {
        if (valid) {
          const that = this

          /*   var captcha = new TencentCaptcha(
               RondomPass().toString(),
               function (res) {
                 console.log(res)
                 if (res.ret === 0) {*/

          that.loading = true
          that.$store.dispatch('user/login', this.loginForm).then((res) => {
            // if(res.role=='ROLE_USER'){

            that.$router.push('/front/home')
            this.$router.go(1)
            localStorage.setItem("user", JSON.stringify(res))
            localStorage.setItem("menus", JSON.stringify(res.menus))  // 存储用户信息到浏览器

            that.loading = false
            // }
            /* else{

             that.$router.push('/')
             //重新加载一次页面
             this.$router.go(0)
             //存进localsession中
             localStorage.setItem("user", JSON.stringify(res))
             localStorage.setItem("menus", JSON.stringify(res.menus))  // 存储用户信息到浏览器

             that.$message({
               type: 'success',
               message: '登陆成功'
             })
             that.loading = false
             }*/
          }).catch((e) => {
            that.loading = false
          })
          /*                  }
                          })
                        captcha.show()*/
        } else {
          console.log('error submit!!')
          return false
        }
      })
    }
  }
}
</script>

<style lang="scss" scope>
/* --------------------------------

Primary style

-------------------------------- */
html * {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

}

*, *:after, *:before {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-size: 100%;
  font-family: "PT Sans", sans-serif;
  color: #505260;
  background-color: white;

}

.bg-back {
  width: 100vw;
  height: 100vh;
}

a {
  color: #2f889a;
  text-decoration: none;
}

img {
  max-width: 100%;
}

input, textarea {
  font-family: "PT Sans", sans-serif;
  font-size: 16px;
  font-size: 1rem;
}

input::-ms-clear, textarea::-ms-clear {
  display: none;
}

/* --------------------------------

Main components

-------------------------------- */
header[role=banner] {
  position: relative;
  height: 50px;
  background: #343642;
}

header[role=banner] #cd-logo {
  float: left;
  margin: 4px 0 0 5%;
  /* reduce logo size on mobile and make sure it is left aligned with the transform-origin property */
  -webkit-transform-origin: 0 50%;
  -moz-transform-origin: 0 50%;
  -ms-transform-origin: 0 50%;
  -o-transform-origin: 0 50%;
  transform-origin: 0 50%;
  -webkit-transform: scale(0.8);
  -moz-transform: scale(0.8);
  -ms-transform: scale(0.8);
  -o-transform: scale(0.8);
  transform: scale(0.8);
}

header[role=banner] #cd-logo img {
  display: block;
}

header[role=banner]::after {
  /* clearfix */
  content: '';
  display: table;
  clear: both;
}

@media only screen and (min-width: 768px) {
  header[role=banner] {
    height: 80px;
  }
  header[role=banner] #cd-logo {
    margin: 20px 0 0 5%;
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -ms-transform: scale(1);
    -o-transform: scale(1);
    transform: scale(1);
  }
}

.main-nav {
  float: right;
  margin-right: 5%;
  width: 44px;
  height: 100%;
  //background: url("../img/cd-icon-menu.svg") no-repeat center center;
  cursor: pointer;
}

.main-nav ul {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  -webkit-transform: translateY(-100%);
  -moz-transform: translateY(-100%);
  -ms-transform: translateY(-100%);
  -o-transform: translateY(-100%);
  transform: translateY(-100%);
}

.main-nav ul.is-visible {
  -webkit-transform: translateY(50px);
  -moz-transform: translateY(50px);
  -ms-transform: translateY(50px);
  -o-transform: translateY(50px);
  transform: translateY(50px);
}

.main-nav a {
  display: block;
  height: 50px;
  line-height: 50px;
  padding-left: 5%;
  background: #292a34;
  border-top: 1px solid #3b3d4b;
  color: #FFF;
}

@media only screen and (min-width: 768px) {
  .main-nav {
    width: auto;
    height: auto;
    background: none;
    cursor: auto;
  }
  .main-nav ul {
    position: static;
    width: auto;
    -webkit-transform: translateY(0);
    -moz-transform: translateY(0);
    -ms-transform: translateY(0);
    -o-transform: translateY(0);
    transform: translateY(0);
    line-height: 80px;
  }
  .main-nav ul.is-visible {
    -webkit-transform: translateY(0);
    -moz-transform: translateY(0);
    -ms-transform: translateY(0);
    -o-transform: translateY(0);
    transform: translateY(0);
  }
  .main-nav li {
    display: inline-block;
    margin-left: 1em;
  }
  .main-nav li:nth-last-child(2) {
    margin-left: 2em;
  }
  .main-nav a {
    display: inline-block;
    height: auto;
    line-height: normal;
    background: transparent;
  }
  .main-nav a.cd-signin, .main-nav a.cd-signup {
    padding: .6em 1em;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50em;
  }
  .main-nav a.cd-signup {
    background: #2f889a;
    border: none;
  }
}

/* --------------------------------

xsigin/signup popup

-------------------------------- */
.cd-user-modal {
}

.cd-user-modal.is-visible {
  visibility: visible;
  opacity: 1;
  -webkit-transition: opacity 0.3s 0, visibility 0 0;
  -moz-transition: opacity 0.3s 0, visibility 0 0;
  transition: opacity 0.3s 0, visibility 0 0;
}

.cd-user-modal.is-visible .cd-user-modal-container {
  -webkit-transform: translateY(0);
  -moz-transform: translateY(0);
  -ms-transform: translateY(0);
  -o-transform: translateY(0);
  transform: translateY(0);
}

.cd-user-modal-container {

  position: relative;
  width: 520px;
  height: 620px;
  background: #FFF;
  margin: 3em auto 4em;
  cursor: auto;
  border-radius: 0.25em;
  //-webkit-transform: translateY(-30px);
  //-moz-transform: translateY(-30px);
  //-ms-transform: translateY(-30px);
  //-o-transform: translateY(-30px);
  //transform: translateY(-30px);
  -webkit-transition-property: -webkit-transform;
  -moz-transition-property: -moz-transform;
  transition-property: transform;
  -webkit-transition-duration: 0.3s;
  -moz-transition-duration: 0.3s;
  transition-duration: 0.3s;
}

.cd-user-modal-container .cd-switcher:after {
  content: "";
  display: table;
  clear: both;
}

.cd-user-modal-container .cd-switcher li {
  width: 40%;
  text-align: center;
  float: left;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
}

.cd-user-modal-container .cd-switcher li:first-child a {
  border-radius: .25em 0 0 0;
}

.cd-user-modal-container .cd-switcher li:last-child a {
  border-radius: 0 .25em 0 0;
}

.cd-user-modal-container .cd-switcher a {
  display: block;
  width: 50%;
  height: 50px;
  font-size: 16px;
  font-weight: bold;
  line-height: 50px;
  color: #809191;
}

.cd-user-modal-container .cd-switcher a.selected {
  background: #FFF;
  color: #505260;
  font-size: 16px;
  font-weight: bold;
  color: #3277FC;
  border-bottom: 5px solid #3277FC;
}

@media only screen and (min-width: 600px) {
  .cd-user-modal-container {
    margin: 20vh auto;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22), 0 14px 56px rgba(0, 0, 0, 0.25);
  }
  .cd-user-modal-container .cd-switcher a {
    height: 70px;
    line-height: 70px;
  }
}

@media only screen and (max-width: 400px) {
  .login {
    overflow: hidden
  }
  .reback {
    position: relative;
    left: 30px;
  }
  .cd-user-modal-container {
    width: 370px;
    height:580px;
    overflow-x: hidden;
    margin: 20vh auto;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22), 0 14px 56px rgba(0, 0, 0, 0.25);
  }
  .cd-user-modal-container .cd-switcher a {
    height: 70px;
    line-height: 70px;
  }
}

.other {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .1);
  text-align: center;
}

.cd-form {
  padding: 1.4em;

}

.cd-form .fieldset {
  position: relative;
  margin: 1.4em 0;
}

.cd-form .fieldset:first-child {
  margin-top: 0;
}

.cd-form .fieldset:last-child {
  margin-bottom: 0;
}

.cd-form label {
  font-size: 14px;
  font-size: 0.875rem;
}

.cd-form label.image-replace {
  /* replace text with an icon */
  display: inline-block;
  position: absolute;
  left: 15px;
  top: 50%;
  bottom: auto;
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);
  height: 20px;
  width: 20px;
  overflow: hidden;
  text-indent: 100%;
  white-space: nowrap;
  color: transparent;
  text-shadow: none;
  background-repeat: no-repeat;
  background-position: 50% 0;
}

.cd-form label.cd-username {
  background-image: url("../../assets/img/cd-icon-username.png");
  background-size: 100%;
}

.cd-form label.cd-email {
  //background-image: url("../img/cd-icon-email.svg");
  background-size: 100%;
}

.cd-form label.cd-password {
  background-image: url("../../assets/img/cd-icon-password.png");
  background-size: 100%;
}

.cd-form input {
  margin: 0;
  padding: 0;
  background-color: #ECEEF0;
  border-radius: 0.25em;
}

.cd-form input.full-width {
  width: 100%;

}

.cd-form input.has-padding {
  padding: 12px 20px 12px 50px;
}

.cd-form input.has-border {
  border: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  -ms-appearance: none;
  -o-appearance: none;
  appearance: none;
}

.cd-form input.has-border:focus {
  border-color: #343642;
  box-shadow: 0 0 5px rgba(52, 54, 66, 0.1);
  outline: none;
}

.cd-form input.has-error {
  border: 1px solid #d76666;
}

.cd-form input[type=password] {
  /* space left for the HIDE button */
  padding-right: 65px;
}

.cd-form input[type=submit] {
  padding: 16px 0;
  margin-top: -1em;
  cursor: pointer;
  color: #ffffff;
  background: #3277FC;
  border-radius: 4px;
  border-radius: 4px;
  font-weight: bold;
  border: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  -ms-appearance: none;
  -o-appearance: none;
  appearance: none;
}

.no-touch .cd-form input[type=submit]:hover, .no-touch .cd-form input[type=submit]:focus {
  background: #3277fcb8;
  outline: none;
}

.cd-form .hide-password {
  width: 120px;
  display: inline-block;
  position: absolute;
  right: 5px;
  font-size: 16px;
  cursor: pointer;
  color: #ffffff;
  background: #3436421a;
  border: 1px solid #979797;
  border-radius: 1px;
  border-radius: 1px;
  font-weight: bold;
  border: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  -ms-appearance: none;
  -o-appearance: none;
  appearance: none;
  top: 0;
  padding: 6px 15px;
  border-left: 1px solid #d2d8d8;
  top: 50%;
  bottom: auto;
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);
  font-size: 14px;
  font-size: 0.875rem;
  color: #3277fc;
}

.cd-form .hide-password:focus {
  outline: none
}

.cd-form .cd-error-message {
  display: inline-block;
  position: absolute;
  left: -5px;
  bottom: -35px;
  background: rgba(215, 102, 102, 0.9);
  padding: .8em;
  z-index: 2;
  color: #FFF;
  font-size: 13px;
  font-size: 0.8125rem;
  border-radius: 0.25em;
  /* prevent click and touch events */
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  -webkit-transition: opacity 0.2s 0, visibility 0 0.2s;
  -moz-transition: opacity 0.2s 0, visibility 0 0.2s;
  transition: opacity 0.2s 0, visibility 0 0.2s;
}

.cd-form .cd-error-message::after {
  /* triangle */
  content: '';
  position: absolute;
  left: 22px;
  bottom: 100%;
  height: 0;
  width: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid rgba(215, 102, 102, 0.9);
}

.cd-form .cd-error-message.is-visible {
  opacity: 1;
  visibility: visible;
  -webkit-transition: opacity 0.2s 0, visibility 0 0;
  -moz-transition: opacity 0.2s 0, visibility 0 0;
  transition: opacity 0.2s 0, visibility 0 0;
}

@media only screen and (min-width: 600px) {
  .cd-form {
    padding: 2em;
  }
  .cd-form .fieldset {
    margin: 2em 0;
  }
  .cd-form .fieldset:first-child {
    margin-top: 0;
  }
  .cd-form .fieldset:last-child {
    margin-bottom: 0;
  }
  .cd-form input.has-padding {
    padding: 16px 20px 16px 50px;
  }
  .cd-form input[type=submit] {
    padding: 16px 0;
  }
}

.cd-form-message {
  padding: 1.4em 1.4em 0;
  font-size: 14px;
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: center;
}

@media only screen and (min-width: 600px) {
  .cd-form-message {
    padding: 2em 2em 0;
  }
}

.cd-form-bottom-message {
  position: absolute;
  width: 100%;
  left: 0;
  bottom: -30px;
  text-align: center;
  font-size: 14px;
  font-size: 0.875rem;
}

.cd-form-bottom-message a {
  color: #FFF;
  text-decoration: underline;
}

.cd-close-form {
  /* form X button on top right */
  display: block;
  position: absolute;
  width: 40px;
  height: 40px;
  right: 0;
  top: -40px;
  //background: url("../img/cd-icon-close.svg") no-repeat center center;
  text-indent: 100%;
  white-space: nowrap;
  overflow: hidden;
}

@media only screen and (min-width: 1170px) {
  .cd-close-form {
    display: none;
  }
}

#cd-login, #cd-signup, #cd-reset-password {
  display: none;
}

#cd-login.is-selected, #cd-signup.is-selected, #cd-reset-password.is-selected {
  display: block;
}

* {
  margin: 0;
  padding: 0;
  list-style: none;
}


.drive,
.shadows {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.drive li {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 1vw 3vw rgba(0, 0, 0, 0.5) inset;
  width: 100vw;
  height: 100vh;
  animation: drive 10s linear infinite;
  animation-direction: reverse;
}

.shadows li {
  position: absolute;
  left: 50%;
  top: 50%;
  background: #000;
  width: 100vw;
  height: 100vh;
  animation: shadows 10s linear infinite;
  animation-direction: reverse;
}

.drive li:nth-child(1) {
  animation-delay: 0;
}

.drive li:nth-child(2) {
  animation-delay: -1s;
}

.drive li:nth-child(3) {
  animation-delay: -2s;
}

.drive li:nth-child(4) {
  animation-delay: -3s;
}

.drive li:nth-child(5) {
  animation-delay: -4s;
}

.drive li:nth-child(6) {
  animation-delay: -5s;
}

.drive li:nth-child(7) {
  animation-delay: -6s;
}

.drive li:nth-child(8) {
  animation-delay: -7s;
}

.drive li:nth-child(9) {
  animation-delay: -8s;
}

.drive li:nth-child(10) {
  animation-delay: -9s;
}

.shadows li:nth-child(1) {
  animation-delay: 0;
}

.shadows li:nth-child(2) {
  animation-delay: -1s;
}

.shadows li:nth-child(3) {
  animation-delay: -2s;
}

.shadows li:nth-child(4) {
  animation-delay: -3s;
}

.shadows li:nth-child(5) {
  animation-delay: -4s;
}

.shadows li:nth-child(6) {
  animation-delay: -5s;
}

.shadows li:nth-child(7) {
  animation-delay: -6s;
}

.shadows li:nth-child(8) {
  animation-delay: -7s;
}

.shadows li:nth-child(9) {
  animation-delay: -8s;
}

.shadows li:nth-child(10) {
  animation-delay: -9s;
}

@keyframes drive {
  0% {
    transform: translate(-50%, -50%) scale(1.05) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) scale(0) rotate(-45deg);
  }
}

@keyframes shadows {
  0% {
    transform: translate(-50%, -50%) scale(1.05) rotate(0deg);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(0) rotate(-45deg);
    opacity: 0.25;
  }
}


</style>

